<html>
<head>
    <script src="KaitaiStream.js"></script>
    <script src="Reftable.js"></script>
</head>
<body>
    <pre id="dump">parsing in process...</pre>
    <script>
        var oReq = new XMLHttpRequest();
        oReq.open("GET", "0x000000000001-0x000000000001-79c60618.ref", true);
        oReq.responseType = "arraybuffer";

        oReq.onload = function (oEvent) {
            var arrayBuffer = oReq.response;
            var parsedReftable = new Reftable(new KaitaiStream(arrayBuffer));
            console.log(parsedReftable)
            document.getElementById("dump").textContent = parsedReftable;
        };

        oReq.send(null);
    </script>
</body>
</html>